# import torch
# import torch.nn as nn

# # 假设 softmax 输出结果
# softmax_outputs = torch.randn(10, 5)  # 形状为 (batch_size, num_classes)

# # 假设真实标签
# labels = torch.tensor([2, 0, 1, 3, 4, 1, 2, 0, 3, 4])  # 形状为 (batch_size,)

# # 创建交叉熵损失函数
# criterion = nn.CrossEntropyLoss()

# print(softmax_outputs.shape)
# print(labels.shape)

# # 计算损失
# loss = criterion(softmax_outputs, labels)

import numpy as np

preds = np.array([1, 2, 3, 4, 5])
targets = np.array([1, 0, 3, 4, 1])
preds_array = np.array(preds)
targets_array = np.array(targets)
equal_array = preds_array == targets_array
equal_ratio = np.mean(equal_array)
print(equal_ratio)